<!doctype html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<!-- 地图放大、缩小 -->
	<view>
		<button class='button' bindtap="add">放大</button>
		<button class='button' bindtap="reduce">缩小</button>
	</view>
<!--放大-->
  add: function (e) {
    var that = this;
    console.log("scale===" + this.data.scale)
    if (this.data.scale > 5) {
      that.setData({
        scale: --this.data.scale
      })
    } else {
      that.show("最大放大级别为5");
    }
  },
<!--缩小-->
  reduce: function (e) {
    var that = this;
    console.log("scale===" + this.data.scale)
    if (this.data.scale < 18) {
      that.setData({
        scale: ++this.data.scale
      })
    } else {
      that.show("最大放大级别为18");
    }
  },
</body>
</html>